import Base64 from 'base-64';

function requestStylePre(options){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	const clientType = uni.getStorageSync('clientType')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	var pageName = options.pagename
	var templetName = options.templatename==undefined ?options.templetname : options.templatename
	var modid = options.modid
	var menuid = options.menuid
	var injson = `{`
				+`"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"templetName":"${templetName}"`
				+`,"pageName":"${pageName}"`
				+`,"menuId":"${menuid}"`
				+`,"modId":"${modid}"`
				+`,"sessionId":"${sessionId}"`
				+`,"userId":"${userId}"`
				+`,"userName":"${userName}"`
				+`}`
	return injson
}

function requestI18n(){
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	var injson = `{"terminalType":"${terminaltype}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"en"`
				+`}`
	return injson
}

function requestDataPre(options,divArea,dataObject,replaceConditions,conditions,pageConditions){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	const clientType = uni.getStorageSync('clientType')
	var pageName = options.pagename
	var templetName = options.templatename==undefined ?options.templetname : options.templatename
	var modid = options.modid
	var menuid = options.menuid
	var injson = `{"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"templetName":"${templetName}"`
				+`,"dataObject":"${dataObject}"`
				+`,"pageName":"${pageName}"`
				+`,"menuId":"${menuid}"`
				+`,"modId":"${modid}"`
				+`,"divArea":"${divArea}"`
				+`,"sessionId":"${sessionId}"`
				+`,"userId":"${userId}"`
				+`,"userName":"${userName}"`
				+`,"replaceConditions":${JSON.stringify(replaceConditions)}`
				+`,"conditions":${JSON.stringify(conditions)}`
				+`,"pageConditions":${JSON.stringify(pageConditions)}`
				+`}`
	return injson
}

function requestDate(){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const clientType = uni.getStorageSync('clientType')
	var injson = `{`
				+`"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"sessionId":"${sessionId}"`
				+`}`
	return injson
}

function requestPageCommitData(options,btn,commitArr,parentPage){
	if(parentPage === undefined) parentPage = '{}'
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	const clientType = uni.getStorageSync('clientType')
	var pageName = options.pagename
	var templetName = options.templatename==undefined ?options.templetname : options.templatename
	var modid = options.modid
	var menuid = options.menuid
	var injson = `{"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"templetName":"${templetName}"`
				+`,"pageName":"${pageName}"`
				+`,"menuId":"${menuid}"`
				+`,"modId":"${modid}"`
				+`,"sessionId":"${sessionId}"`
				+`,"userId":"${userId}"`
				+`,"userName":"${userName}"`
				+`,"btnName":"${btn.name}"`
				+`,"btnText":"${btn.text}"`
				+`,"parentPage":${parentPage}`
				+`,"commitArr":${JSON.stringify(commitArr)}`
				+`}`
	return injson
}

function requestCheckData(options,divArea,dataObject,dataArr,checkBeforeDo){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	const clientType = uni.getStorageSync('clientType')
	var pageName = options.pagename
	var templetName = options.templatename==undefined ?options.templetname : options.templatename
	var modid = options.modid
	var menuid = options.menuid
	var injson = `{"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"templetName":"${templetName}"`
				+`,"pageName":"${pageName}"`
				+`,"menuId":"${menuid}"`
				+`,"modId":"${modid}"`
				+`,"sessionId":"${sessionId}"`
				+`,"userId":"${userId}"`
				+`,"userName":"${userName}"`
				+`,"dataObject":"${dataObject}"`
				+`,"divArea":"${divArea}"`
				+`,"btnName":""`
				+`,"btnText":""`
				+`,"dataArr":${JSON.stringify(dataArr)}`
				+`,"checkBeforeDo":${JSON.stringify(checkBeforeDo)}`
				+`}`
	return injson
}

function requestPassword(oldPassword,newPassword){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	const clientType = uni.getStorageSync('clientType')
	const loginId = uni.getStorageSync('accountid')
	const partnerCode = uni.getStorageSync('partnerCode')
	const partnerName = uni.getStorageSync('partnerName')

	var injson = `{"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"partnerCode":"${partnerCode}"`
				+`,"partnerName":"${partnerName}"`
				+`,"sessionId":"${sessionId}"`
				+`,"userId":"${userId}"`
				+`,"loginId":"${loginId}"`
				+`,"userName":"${userName}"`
				+`,"oldPassword":"${Base64.encode(oldPassword)}"`
				+`,"newPassword":"${Base64.encode(newPassword)}"`
				+`}`
	return injson
}

function requestAppId(wx_appid,wx_uid,wx_serviceid){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	const clientType = uni.getStorageSync('clientType')
	const loginId = uni.getStorageSync('accountid')
	const partnerCode = uni.getStorageSync('partnerCode')
	const partnerName = uni.getStorageSync('partnerName')
	var injson = `{"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"partnerCode":"${partnerCode}"`
				+`,"partnerName":"${partnerName}"`
				+`,"sessionId":"${sessionId}"`
				+`,"userId":"${userId}"`
				+`,"loginId":"${loginId}"`
				+`,"userName":"${userName}"`
				+`,"wx_appid":"${wx_appid}"`
				+`,"wx_uid":"${wx_uid}"`
				+`,"wx_serviceid":"${wx_serviceid}"`
				+`}`
	return injson
}

function Login(mac, machineName, loginId, password){
	const productCode = uni.getStorageSync('productCode')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const clientType = uni.getStorageSync('clientType')
	const accountName = uni.getStorageSync('accountName')
	var injson = `{`
				+`"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"accountName":"${accountName}"`
				+`,"ip":""`
				+`,"mac":"${mac}"`
				+`,"hardwareCode":"${mac}"`
				+`,"machineName":"${machineName}"`
				+`,"loginId":"${loginId}"`
				+`,"password":"${Base64.encode(password)}"`
				+`}`
	return injson
}

function pwdwxLogin(mac, machineName, loginId, password,openId, nickName){
	const productCode = uni.getStorageSync('productCode')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const clientType = uni.getStorageSync('clientType')
	const accountName = uni.getStorageSync('accountName')
	var injson = `{`
				+`"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"accountName":"${accountName}"`
				+`,"ip":""`
				+`,"mac":"${mac}"`
				+`,"hardwareCode":"${mac}"`
				+`,"machineName":"${machineName}"`
				+`,"loginId":"${loginId}"`
				+`,"password":"${Base64.encode(password)}"`
				+`,"openId":"${openId}"`
				+`,"nickName":"${nickName}"`
				+`}`
	return injson
}

function smsLogin(mac, machineName, mobile, verificationCode){
	const productCode = uni.getStorageSync('productCode')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const clientType = uni.getStorageSync('clientType')
	const accountName = uni.getStorageSync('accountName')
	var injson = `{`
				+`"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"accountName":"${accountName}"`
				+`,"ip":""`
				+`,"mac":"${mac}"`
				+`,"hardwareCode":"${mac}"`
				+`,"machineName":"${machineName}"`
				+`,"mobile":"${mobile}"`
				+`,"verificationCode":"${verificationCode}"`
				+`}`
	return injson
}

function smswxLogin(mac, machineName, mobile, verificationCode,openId, nickName){
	const productCode = uni.getStorageSync('productCode')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const clientType = uni.getStorageSync('clientType')
	const accountName = uni.getStorageSync('accountName')
	var injson = `{`
				+`"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"accountName":"${accountName}"`
				+`,"ip":""`
				+`,"mac":"${mac}"`
				+`,"hardwareCode":"${mac}"`
				+`,"machineName":"${machineName}"`
				+`,"mobile":"${mobile}"`
				+`,"verificationCode":"${verificationCode}"`
				+`,"openId":"${openId}"`
				+`,"nickName":"${nickName}"`
				+`}`
	return injson
}

function wxLogin(mac, machineName, openId, nickName){
	const productCode = uni.getStorageSync('productCode')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const clientType = uni.getStorageSync('clientType')
	const accountName = uni.getStorageSync('accountName')
	var injson = `{`
				+`"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"accountName":"${accountName}"`
				+`,"ip":""`
				+`,"mac":"${mac}"`
				+`,"hardwareCode":"${mac}"`
				+`,"machineName":"${machineName}"`
				+`,"openId":"${openId}"`
				+`,"nickName":"${nickName}"`
				+`}`
	return injson
}

function saas_UserLoginBySMS_GetPin(mac, machineName, mobile){
	const productCode = uni.getStorageSync('productCode')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const clientType = uni.getStorageSync('clientType')
	const accountName = uni.getStorageSync('accountName')
	var injson = `{`
				+`"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"accountName":"${accountName}"`
				+`,"hostIp":""`
				+`,"hostMac":"${mac}"`
				+`,"hostName":"${machineName}"`
				+`,"mobile":"${mobile}"`
				+`}`
	return injson
}

function LoginCheck(mac, machineName, lr, loginId){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	const clientType = uni.getStorageSync('clientType')
	const partnerCode = uni.getStorageSync('partnerCode')
	var injson = `{`
				+`"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"hostIP":""`
				+`,"hostMac":"${mac}"`
				+`,"hostName":"${machineName}"`
				+`,"partnerCode":"${lr.partnerCode}"`
				+`,"loginId":"${loginId}"`
				+`,"sessionId":"${lr.sessionId}"`
				+`,"userId":"${lr.userId}"`
				+`,"userName":"${lr.userName}"`
				+`}`
	return injson
}

function PageInfo(mac,machineName){
	const productCode = uni.getStorageSync('productCode')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const menuId = uni.getStorageSync('loginmenuId')
	const modId = uni.getStorageSync('loginmodId')
	const pageName = uni.getStorageSync('loginpageName')
	const templetName = uni.getStorageSync('logintempletName')
	const clientType = uni.getStorageSync('clientType')
	var injson = `{`
				+`"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"ip":""`
				+`,"mac":"${mac}"`
				+`,"machineName":"${machineName}"`
				+`,"templetName":"${templetName}"`
				+`,"pageName":"${pageName}"`
				+`,"menuId":"${menuId}"`
				+`,"modId":"${pageName}"`
				+`,"sessionId":""`
				+`}`
	return injson
}

function PageDivDataCreatePdf(options,divArea,dataObject,replaceConditions,conditions,pageConditions,fileService){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	const clientType = uni.getStorageSync('clientType')
	const partnerCode = uni.getStorageSync('partnerCode')
	var pageName = options.pagename
	var templetName =options.templatename==undefined ?options.templetname : options.templatename
	var modid = options.modid
	var menuid = options.menuid
	var injson = `{"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"templetName":"${templetName}"`
				+`,"dataObject":"${dataObject}"`
				+`,"pageName":"${pageName}"`
				+`,"menuId":"${menuid}"`
				+`,"modId":"${modid}"`
				+`,"divArea":"${divArea}"`
				+`,"sessionId":"${sessionId}"`
				+`,"partnerCode":"${partnerCode}"`
				+`,"userId":"${userId}"`
				+`,"userName":"${userName}"`
				+`,"fileService":"${fileService}"`
				+`,"replaceConditions":${JSON.stringify(replaceConditions)}`
				+`,"conditions":${JSON.stringify(conditions)}`
				+`,"pageConditions":${JSON.stringify(pageConditions)}`
				+`}`
	return injson
}

function PrinterListByBillType(options,dataObject,divArea,billType){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	const clientType = uni.getStorageSync('clientType')
	const partnerCode = uni.getStorageSync('partnerCode')
	var pageName = options.pagename
	var templetName = options.templatename==undefined ?options.templetname : options.templatename
	var modid = options.modid
	var menuid = options.menuid
	var injson = `{"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"templetName":"${templetName}"`
				+`,"dataObject":"${dataObject}"`
				+`,"pageName":"${pageName}"`
				+`,"menuId":"${menuid}"`
				+`,"modId":"${modid}"`
				+`,"divArea":"${divArea}"`
				+`,"sessionId":"${sessionId}"`
				+`,"partnerCode":"${partnerCode}"`
				+`,"userId":"${userId}"`
				+`,"userName":"${userName}"`
				+`,"billType":"${billType}"`
				+`}`
	return injson
}

function PrintJobAdd(options,dataObject,divArea,printJob){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	const clientType = uni.getStorageSync('clientType')
	const partnerCode = uni.getStorageSync('partnerCode')
	var pageName = options.pagename
	var templetName =options.templatename==undefined ?options.templetname : options.templatename
	var modid = options.modid
	var menuid = options.menuid
	var injson = `{"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"clientType":"${clientType}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"templetName":"${templetName}"`
				+`,"dataObject":"${dataObject}"`
				+`,"pageName":"${pageName}"`
				+`,"menuId":"${menuid}"`
				+`,"modId":"${modid}"`
				+`,"divArea":"${divArea}"`
				+`,"sessionId":"${sessionId}"`
				+`,"partnerCode":"${partnerCode}"`
				+`,"userId":"${userId}"`
				+`,"userName":"${userName}"`
				+`,"printJob":${JSON.stringify( printJob)}`
				+`}`
	return injson

}

function requestPageDivChildStyle(options,divArea,dataObject,colName){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	var pageName = options.pagename
	var templetName =options.templetname
	var modid = options.modid
	var menuid = options.menuid
	var injson = `{"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"templetName":"${templetName}"`
				+`,"childDataObject":"${dataObject}"`
				+`,"pageName":"${pageName}"`
				+`,"menuId":"${menuid}"`
				+`,"modId":"${modid}"`
				+`,"divArea":"${divArea}"`
				+`,"sessionId":"${sessionId}"`
				+`,"colName":"${colName}"`
				+`,"userId":"${userId}"`
				+`,"userName":"${userName}"`
				+`}`
	return injson
}

function requestPageDivChildData(options,divArea,dataObject,colName,filterConditions,conditions,replaceConditions,pageConditions){
	const productCode = uni.getStorageSync('productCode')
	const sessionId = uni.getStorageSync('sessionId')
	const projectCode = uni.getStorageSync('projectCode')
	const terminaltype = uni.getStorageSync('terminaltype')
	const dbId = uni.getStorageSync('dbId')
	const i18n = uni.getStorageSync('i18n')===''?'cn':uni.getStorageSync('i18n')
	const userId = uni.getStorageSync('userId')
	const userName = uni.getStorageSync('userName')
	var pageName = options.pagename
	var templetName =options.templetname
	var modid = options.modid
	var menuid = options.menuid
	var injson = `{"productCode":"${productCode}"`
				+`,"terminalType":"${terminaltype}"`
				+`,"projectCode":"${projectCode}"`
				+`,"dbId":"${dbId}"`
				+`,"i18n":"${i18n}"`
				+`,"templetName":"${templetName}"`
				+`,"childDataObject":"${dataObject}"`
				+`,"pageName":"${pageName}"`
				+`,"menuId":"${menuid}"`
				+`,"modId":"${modid}"`
				+`,"divArea":"${divArea}"`
				+`,"sessionId":"${sessionId}"`
				+`,"colName":"${colName}"`
				+`,"userId":"${userId}"`
				+`,"userName":"${userName}"`
				+`,"filterConditions":${JSON.stringify(filterConditions)}`
				+`,"replaceConditions":${replaceConditions}`
				+`,"conditions":${conditions}`
				+`,"pageConditions":${JSON.stringify(pageConditions)}`
				+`}`
	return injson
}






module.exports = {
	requestStylePre,
	requestDataPre,
	requestDate,
	requestPageCommitData,
	requestPassword,
	requestAppId,
	requestCheckData,
	Login,
	LoginCheck,
	PageInfo,
	PageDivDataCreatePdf,
	PrinterListByBillType,
	PrintJobAdd,
	wxLogin,
	smsLogin,
	saas_UserLoginBySMS_GetPin,
	pwdwxLogin,
	smswxLogin,
	requestI18n,
	requestPageDivChildStyle,
	requestPageDivChildData
}